#include "stdafx.h"

DOMgr::~DOMgr()
{
	for (DynamicObject * obj : dynamics)
	{
		delete obj;
	}
}

DOMgr * DOMgr::getInstance()
{
	static DOMgr manager;

	return &manager;
}

void DOMgr::create(const std::wstring & DOname, double x, double y)
{
	if (DOname == L"LevelCircle")
	{
		dynamics.push_back(new LevelCircle(L"circle", x, y));
	}
}

void DOMgr::update(double dtime)
{
	for (DynamicObject * obj : dynamics)
	{
		obj->update(dtime);
	}
}

void DOMgr::draw(Graphics * graphics)
{
	for (DynamicObject * obj : dynamics)
	{
		obj->draw(graphics);
	}
}